// api/classApi.ts
import request from '@/utils/request'


export function getClassList(params) {
    return request({
        url: '/api/classes',
        method: 'get',
        params
    })
}

export function createClass(data) {
    return request({
        url: '/api/classes',
        method: 'post',
        data
    })
}

export function updateClass(data) {
    return request({
        url: `/api/classes`,
        method: 'put',
        data
    })
}

export function deleteClass(id) {
    return request({
        url: `/api/classes/${id}`,
        method: 'delete'
    })
}

export function batchDeleteClass(data) {
    return request({
        url: '/api/classes',
        method: 'delete',
        data
    })
}

export function getClassDetail(id) {
    return request({
        url: `/api/classes/${id}`,
        method: 'get'
    })
}

export function getAllTeachers() {
    return request({
        url: '/api/teachers/all',  // 假设接口返回 [{ id, name }]
        method: 'get'
    })
}
